<include file="Public/header" />
<include file="Public/menu" />

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            首页
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">列表1</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">

        <div class="row"><div class="col-md-12"><div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">新增</h3>

                <div class="box-tools">

                    <div class="btn-group pull-right" style="margin-right: 10px">
                        <a href="{:U('Weixin/twoDBarcode')}" class="btn btn-sm btn-default"><i class="fa fa-list"></i>&nbsp;List</a>
                    </div>
                </div>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form action="{:U('Weixin/doNewTwoDBarcode')}" method="post" id="DB-code-form" accept-charset="UTF-8" class="form-horizontal" pjax-container="">
                <div class="box-body">

                    <div class="form-group">
                        <label class="col-sm-2 control-label">二维码名称</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <input type="text" class="form-control" name="barcode_name" id="barcode_name" placeholder="二维码名称">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">二维码参数</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <input type="text" class="form-control" name="b_parameter" id="b_parameter" placeholder="二维码参数">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">门店</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <select class="form-control" name="local_id">
                                    <option value="0">-请选择-</option>
                                    <foreach name="store" item="v" key="k" >
                                        <option value="{$k}">{$v}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <textarea class="form-control" rows="3" name="remark"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <input type="hidden" name="_token" value="7lMdsZohP4DDH6f9Pvt6gn9e8TR3yOc34ovag8h3">
                    <div class="col-sm-2">

                    </div>
                    <div class="col-sm-6">

                        <div class="btn-group pull-right">
                            <button type="submit" class="btn btn-info pull-right">提交</button>
                        </div>

                        <div class="btn-group pull-left">
                            <a href="{:U('Weixin/twoDBarcode')}" class="btn btn-warning">&nbsp;取消</a>
                        </div>

                    </div>

                </div>
                <!-- /.box-footer -->
            </form>
        </div>

        </div></div>

    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer" />
<script>
    $("#DB-code-form").validate({
        rules: {
            barcode_name:{
                required: true,
                rangelength: [2, 50]
            },
            b_parameter: {
                required: true,
                isUsername: true
            }
        },
        messages:{
            barcode_name: {
                required: "请输二维码店名称",
                rangelength: "二维码名称长度在2到50个字符之间"
            },

            b_parameter: {
                maxlength: "自提备注最多可输入3个字符"
            }
        },
        submitHandler: function(form){
            form.submit();   //提交表单
        }
    });
</script>

